/** Entry point */
function wfSpecialGroups() {
global $wgRequest;
-
+
$form = new GroupsForm($wgRequest);
$form->execute();
}
var $mPosted, $mRequest, $mSaveprefs, $mChangeAllowed;
var $mNewName, $mDescription, $mOldName, $mRights, $mId;
var $mAdd, $mEdit;
-
+
/** Escaped local url name*/
var $action, $location;
/** Constructor*/
function GroupsForm ( &$request ) {
global $wgUser;
-
+
$this->mPosted = $request->wasPosted();
$this->mRequest =& $request;
$this->mName = 'groups';
} elseif ( $this->mEdit ) {
if ( $this->mPosted ) {
$wgOut->redirect( $this->location );
- } else {
+ } else {
$this->switchForm();
$this->editGroupForm( $this->mId );
}
global $wgOut;
$this->mNewName = trim($this->mNewName);
-
+
if ( $this->mNewName == '' ) {
$this->editGroupForm( $this->mGroupID, 'groups-noname' );
return false;
return;
}
}
-
+
// save stuff
$g->setName($this->mNewName);
$g->setDescription($this->mDescription);
if( is_array( $this->mRights ) ) {
$g->setRights( implode(',',$this->mRights) );
}
-
+
$g->save();
-
+
// Make the log entry
$log = new LogPage( 'rights' );
$dummyTitle = Title::makeTitle( 0, '' );
*/
function switchForm() {
global $wgOut;
-
- // group selection
+
+ // group selection
$wgOut->addHTML( "<form name=\"ulgroup\" action=\"$this->action\" method=\"post\">\n" );
$wgOut->addHTML( $this->fieldset( 'lookup-group',
HTMLSelectGroups('id', $this->mName.'-group-edit', array(0 => $this->mRequest->getVal('id')) ) .
$s .= "|}\n";
$wgOut->addWikiText( $s );
}
-
+
function showRecord() {
global $wgOut;
-
+
$groups =& Group::getAllGroups();
$rec = serialize( $groups );
// Split it into lines